package com.training.dto;

import com.training.entity.Comment;
import com.training.entity.CommentReply; // 导入新实体
import lombok.Data;
import java.time.LocalDateTime;

@Data
public class CommentDisplayDto {
    // 您原有的字段
    private Long commentId;
    private Long courseId;
    private Long studentId;
    private String studentName;
    private String content;
    private Integer rating;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;

    // 新增字段
    private String courseName;
    private CommentReply reply;

    // 保留您原有的构造函数
    public CommentDisplayDto(Comment comment) {
        this.commentId = comment.getId();
        this.courseId = comment.getCourseId();
        this.studentId = comment.getUserId();
        this.content = comment.getContent();
        this.rating = comment.getRating();
        this.createTime = comment.getCreateTime();
        this.updateTime = comment.getUpdateTime();
    }

    public CommentDisplayDto() {
    }
}